package tx.bjdacp.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bjdacp.model.*;
import tx.bjdacp.dao.*;
import tx.bjdacp.service.*;
import tx.bjdacp.vo.query.*;


@Entity
@Table(name = "bjdacp_file_catalog")
public class FileCatalog extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	//alias
	public static final String TABLE_ALIAS = "卷内文件目录";
	public static final String ALIAS_FILE_CATALOG_ID = "fileCatalogId";
	public static final String ALIAS_TOTAL_CATALOG_ID = "totalCatalogId";
	public static final String ALIAS_SEQ_NUM = "顺序号";
	public static final String ALIAS_REF_NUM = "文号";
	public static final String ALIAS_DUTY_PERSON = "责任者";
	public static final String ALIAS_FILE_CATALOG_NAME = "题名";
	public static final String ALIAS_FILE_CATALOG_DATE = "日期";
	public static final String ALIAS_PAGE_NUM = "页号";
	public static final String ALIAS_REMARK = "备注";

	//date formats


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * fileCatalogId       db_column: file_catalog_id
     */

	private java.lang.Integer fileCatalogId;
    /**
     * totalCatalogId       db_column: total_catalog_id
     */

	private java.lang.Integer totalCatalogId;
    /**
     * seqNum       db_column: seq_num
     */
	@Length(max=100)
	private java.lang.String seqNum;
    /**
     * refNum       db_column: ref_num
     */
	@Length(max=100)
	private java.lang.String refNum;
    /**
     * dutyPerson       db_column: duty_person
     */
	@Length(max=100)
	private java.lang.String dutyPerson;
    /**
     * fileCatalogName       db_column: file_catalog_name
     */
	@Length(max=100)
	private java.lang.String fileCatalogName;
    /**
     * fileCatalogDate       db_column: file_catalog_date
     */
	@Length(max=100)
	private java.lang.String fileCatalogDate;
    /**
     * pageNum       db_column: page_num
     */
	@Length(max=100)
	private java.lang.String pageNum;
    /**
     * remark       db_column: remark
     */
	@Length(max=1000)
	private java.lang.String remark;
	//columns END


	public FileCatalog(){
	}

	public FileCatalog(
		java.lang.Integer fileCatalogId
	){
		this.fileCatalogId = fileCatalogId;
	}



	public void setFileCatalogId(java.lang.Integer value) {
		this.fileCatalogId = value;
	}

	@Id	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "file_catalog_id", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getFileCatalogId() {
		return this.fileCatalogId;
	}

	@Column(name = "total_catalog_id", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTotalCatalogId() {
		return this.totalCatalogId;
	}

	public void setTotalCatalogId(java.lang.Integer value) {
		this.totalCatalogId = value;
	}

	@Column(name = "seq_num", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getSeqNum() {
		return this.seqNum;
	}

	public void setSeqNum(java.lang.String value) {
		this.seqNum = value;
	}

	@Column(name = "ref_num", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getRefNum() {
		return this.refNum;
	}

	public void setRefNum(java.lang.String value) {
		this.refNum = value;
	}

	@Column(name = "duty_person", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getDutyPerson() {
		return this.dutyPerson;
	}

	public void setDutyPerson(java.lang.String value) {
		this.dutyPerson = value;
	}

	@Column(name = "file_catalog_name", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getFileCatalogName() {
		return this.fileCatalogName;
	}

	public void setFileCatalogName(java.lang.String value) {
		this.fileCatalogName = value;
	}

	@Column(name = "file_catalog_date", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getFileCatalogDate() {
		return this.fileCatalogDate;
	}

	public void setFileCatalogDate(java.lang.String value) {
		this.fileCatalogDate = value;
	}

	@Column(name = "page_num", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getPageNum() {
		return this.pageNum;
	}

	public void setPageNum(java.lang.String value) {
		this.pageNum = value;
	}

	@Column(name = "remark", unique = false, nullable = true, insertable = true, updatable = true, length = 1000)
	public java.lang.String getRemark() {
		return this.remark;
	}

	public void setRemark(java.lang.String value) {
		this.remark = value;
	}


	private TotalCatalog totalCatalog;
	public void setTotalCatalog(TotalCatalog totalCatalog){
		this.totalCatalog = totalCatalog;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "total_catalog_id",nullable = false, insertable = false, updatable = false)
	})
	public TotalCatalog getTotalCatalog() {
		return totalCatalog;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("FileCatalogId",getFileCatalogId())
			.append("TotalCatalogId",getTotalCatalogId())
			.append("SeqNum",getSeqNum())
			.append("RefNum",getRefNum())
			.append("DutyPerson",getDutyPerson())
			.append("FileCatalogName",getFileCatalogName())
			.append("FileCatalogDate",getFileCatalogDate())
			.append("PageNum",getPageNum())
			.append("Remark",getRemark())
			.toString();
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getFileCatalogId())
			.toHashCode();
	}

	public boolean equals(Object obj) {
		if(obj instanceof FileCatalog == false) return false;
		if(this == obj) return true;
		FileCatalog other = (FileCatalog)obj;
		return new EqualsBuilder()
			.append(getFileCatalogId(),other.getFileCatalogId())
			.isEquals();
	}
}

